<?php
/**
 * 微校云主界面模型
 * Author: 孙武 QQ:1228746736
 * Date: 2017/11/1
 * Time: 10:37
 */

namespace Home\Model;
class OrderModel extends \Think\Model{

    public function checkIsExistOrder($addrID)
    {
        $sql="select count(od_pay_status) as total from bus_order where od_addr_id=$addrID and od_pay_status=0";
        $res=D()->query($sql);
        if($res[0]['total']>0){
            return true;
        }else{
            return false;
        }
    }


    /**
     * 根据乘客的ids返回乘客的信息
     * @param array $ids
     */
    public function getPsrInfoByIds($ids=array())
    {
        $psrIds = implode(',', $ids);//数组转换为字符串
        if(strlen($psrIds)<1){
            return;
        }
        $map['psr_id']=array('in',$psrIds);
        return M('passenger')->where($map)->select();

    }
}